﻿using System;

namespace SSP.Api
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class DirectorApp : DirectorWrapper
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DirectorApp"/> class.
        /// </summary>
        /// <param name="director">The director.</param>
        public DirectorApp(Director director) : base(director)
        {
        }


        /// <summary>
        /// The Director version on the host.
        /// </summary>
        /// <value>The version.</value>
        /// <returns></returns>
        public string Version
        {
            get
            {
                var response = Parent.send("app_version");
                return response.Version;
            }
        }

        /// <summary>
        /// Gets the SSP API version.
        /// </summary>
        /// <value>The SSP API version.</value>
        public string ApiVersion
        {
            get
            {
                return GetType().Assembly.GetName().Version.ToString();
            }
        }

        /// <summary>
        /// The upload file size limit.
        /// </summary>
        /// <value>The limits.</value>
        /// <returns></returns>
        public string Limits
        {
            get
            {
                var response = Parent.send("app_limits");
                return response.UploadLimit;
            }
        }

        /// <summary>
        /// Returns the total number of objects uploaded to Director and also the aggregate file size of those files.
        /// </summary>
        /// <value>The totals.</value>
        /// <returns></returns>
        public DirectorResponse Totals
        {
            get
            {
                var response = Parent.send("app_totals");
                return response;
            }
        }
    }
}